package com.game.view.layer.gameMap
{
	import com.dusk.util.ResUtil;
	import com.game.manager.GameSceneManager;
	import com.game.manager.NotificationManager;
	
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	public class HellMap extends GameMapBase implements IGameMap
	{
		
		public function HellMap():void
		{
			super();
		}
		
		public var s5_1:MovieClip;
		public var s5_2:MovieClip;
		public var s5_3:MovieClip;
		public var s6_1:MovieClip;
		public var s6_2:MovieClip;
		public var s6_3:MovieClip;
		public var s7_1:MovieClip;
		public var s7_2:MovieClip;
		public var s7_3:MovieClip;
		public var s8_1:MovieClip;
		public var s8_2:MovieClip;
		public var s8_3:MovieClip;
		public var toIsland:MovieClip;
		public var deepHell:MovieClip;
		
		override protected function beforeAdded():void
		{
			setMapIndex(5,8);
			var map:MovieClip = ResUtil.getLayerView("HellMap") as MovieClip;
			for (var stageNum:int = MAP_INDEX.MIN; stageNum <= MAP_INDEX.MAX; stageNum++)
			{
				levelNum = 0;
				for (var levelNum:int = 1; levelNum <= 3; levelNum++)
				{
					if (this.hasOwnProperty("s" + stageNum + "_" + levelNum) && map.getChildByName("s" + stageNum + "_" + levelNum) != null)
					{
						this["s" + stageNum + "_" + levelNum] = map.getChildByName("s" + stageNum + "_" + levelNum);
					}
				}
			}
			toIsland = map.getChildByName("toIsland") as MovieClip;
			toIsland.gotoAndStop(1);
			deepHell = map.getChildByName("deepHell") as MovieClip;
			deepHell.gotoAndStop(1);
			addChild(map);
		}
		
		override protected function onAdded():void
		{
			super.onAdded();
			setActivate(toIsland);
			toIsland.addEventListener(MouseEvent.CLICK, changeMap);
			setActivate(deepHell);
			deepHell.addEventListener(MouseEvent.CLICK, deepHellClick);
		}
		
		override protected function onRemoved():void
		{
			super.onRemoved();
			setDeactivate(toIsland);
			toIsland.removeEventListener(MouseEvent.CLICK, changeMap);
			setDeactivate(deepHell);
			deepHell.removeEventListener(MouseEvent.CLICK, deepHellClick);
		}
		
		private function deepHellClick(evt:MouseEvent):void
		{
			NotificationManager.alert("暂未开启");
		}
		
		private function changeMap(param1:MouseEvent):void
		{
			GameSceneManager.getIns().showGameMap(GameSceneManager.MAP_ISLAND);
		}
	}
}
